{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f50c9bbf4672468ba47b7323ca3faf30",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/690 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "725dd81ac424487c95c3c28ec986fd0d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/3.69k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fa3a74af41544218bbd34c3f54272fab",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/629 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "12b9806ae3dd494195ed32056d2cc245",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/122 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "7b9f820a8d77434a9c43ba245e11a9ab",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/229 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "861676d2636d4df698a7a6149cce787a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/90.9M [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4a2dd880479f4630b45cfcb4dfaf1c74",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/53.0 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "96548678ac254d51a51838ab7a34863d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/112 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "069a15a08f024ff2bb183ab2b67b5c15",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/466k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "061164d927ad433f9be7c28c8bece93e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/314 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "193d139731c84ab2990de574228d2d67",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/232k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ef8aaf8b842a4676bb68e7db3ffef7ba",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/190 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sentence: This framework generates embeddings for each input sentence\n",
      "Embedding: [-1.76214561e-01  1.20601416e-01 -2.93624043e-01 -2.29858190e-01\n",
      " -8.22924674e-02  2.37709343e-01  3.39985192e-01 -7.80964315e-01\n",
      "  1.18127637e-01  1.63373947e-01 -1.37715235e-01  2.40282446e-01\n",
      "  4.25125569e-01  1.72417879e-01  1.05279632e-01  5.18164158e-01\n",
      "  6.22218102e-02  3.99285942e-01 -1.81652650e-01 -5.85578859e-01\n",
      "  4.49716486e-02 -1.72750577e-01 -2.68443376e-01 -1.47386014e-01\n",
      " -1.89217821e-01  1.92150652e-01 -3.83842528e-01 -3.96006852e-01\n",
      "  4.30648863e-01 -3.15319359e-01  3.65949959e-01  6.05157688e-02\n",
      "  3.57325703e-01  1.59736231e-01 -3.00984085e-01  2.63250172e-01\n",
      " -3.94311130e-01  1.84855402e-01 -3.99548888e-01 -2.67889768e-01\n",
      " -5.45117199e-01 -3.13407108e-02 -4.30644035e-01  1.33278131e-01\n",
      " -1.74793929e-01 -4.35465515e-01 -4.77379203e-01  7.12557212e-02\n",
      " -7.37001151e-02  5.69136858e-01 -2.82579392e-01  5.24974614e-02\n",
      " -8.20007980e-01  1.98297173e-01  1.69511929e-01  2.71779925e-01\n",
      "  2.64610618e-01 -2.55739018e-02 -1.74096510e-01  1.63314253e-01\n",
      " -3.95260870e-01 -3.17557752e-02 -2.62556195e-01  3.52754384e-01\n",
      "  3.01434666e-01 -1.47197381e-01  2.10075870e-01 -1.84010416e-01\n",
      " -4.12895828e-01  4.14775968e-01 -1.89769536e-01 -1.35481969e-01\n",
      " -3.79272431e-01 -4.68023457e-02 -3.33600715e-02  9.00393650e-02\n",
      " -3.30132961e-01 -3.87315154e-02  3.75082165e-01 -1.46996737e-01\n",
      "  4.34959710e-01  5.38325846e-01 -2.65445262e-01  1.64445698e-01\n",
      "  4.17078435e-01 -4.72507663e-02 -7.48732388e-02 -4.26260680e-01\n",
      " -1.96994513e-01  6.10317215e-02 -4.74262863e-01 -6.48334622e-01\n",
      "  3.71462494e-01  2.50956804e-01  1.22529760e-01  8.88767615e-02\n",
      " -1.06724337e-01  5.33982962e-02  9.74505395e-02 -3.46654914e-02\n",
      " -1.02882929e-01  2.32289046e-01 -2.53739804e-01 -5.13112128e-01\n",
      "  1.85216114e-01 -3.04357708e-01 -3.55211571e-02 -1.26974851e-01\n",
      " -7.71632344e-02 -5.15329897e-01 -2.28071839e-01  2.03343816e-02\n",
      "  7.38175362e-02 -1.52558237e-01 -4.00837690e-01 -2.47749358e-01\n",
      "  3.97470534e-01 -2.60260642e-01  2.50905931e-01  1.68229133e-01\n",
      "  1.33900195e-01 -2.10835375e-02 -4.70035344e-01  4.78850067e-01\n",
      "  2.80345619e-01 -4.64546949e-01  3.21747005e-01  2.34207228e-01\n",
      "  2.45772034e-01 -4.71482396e-01  5.00401258e-01  4.10190076e-01\n",
      "  5.15216529e-01  2.62549371e-01  2.11588405e-02 -3.89687330e-01\n",
      " -2.41742939e-01 -2.14834526e-01 -8.62651393e-02 -1.65323466e-01\n",
      " -5.21894731e-02  3.41874599e-01  4.50314462e-01 -3.06973547e-01\n",
      " -2.02294171e-01  6.85521662e-01 -5.33892572e-01  3.58471513e-01\n",
      "  1.45286694e-01 -7.07059354e-02 -1.50529414e-01 -8.56278688e-02\n",
      " -7.67849833e-02  1.89544678e-01 -1.04067311e-01  5.33543706e-01\n",
      " -5.27887285e-01  2.42331810e-02 -2.64347672e-01 -2.23186672e-01\n",
      " -3.81208867e-01  7.59914666e-02 -4.64484960e-01 -3.36549252e-01\n",
      "  4.21229690e-01  1.07479200e-01  1.90457925e-01  2.89501599e-03\n",
      " -1.08513720e-01  1.53545380e-01  3.16023409e-01 -2.70839911e-02\n",
      " -5.40594459e-01  8.97287577e-02 -1.15549475e-01  3.97803813e-01\n",
      " -4.97683167e-01 -2.84893543e-01  4.99865040e-02  3.61279458e-01\n",
      "  6.90535486e-01  1.46821558e-01  1.73396349e-01 -1.74582303e-01\n",
      " -3.15702498e-01  6.72997534e-02  2.17250079e-01  9.78538096e-02\n",
      " -1.29472762e-01 -1.86929852e-01  1.34878054e-01 -1.53885424e-01\n",
      "  7.44716227e-02 -1.85536012e-01 -2.80628294e-01 -1.14144251e-01\n",
      "  4.12249386e-01  6.39496371e-02 -1.45715296e-01 -9.82063115e-02\n",
      " -1.33081883e-01 -1.88410535e-01 -2.84842476e-02 -3.49508487e-02\n",
      "  3.34262624e-02  6.98897913e-02  1.90354437e-01 -2.96723843e-01\n",
      "  2.64711562e-03  1.09140784e-01  1.70896631e-02  2.60589242e-01\n",
      "  3.29038352e-01 -6.61558583e-02  2.39665493e-01 -2.26194784e-01\n",
      " -3.36867645e-02  1.49400547e-01 -3.21265280e-01 -2.68577784e-01\n",
      "  5.72631836e-01 -4.92308259e-01  2.00666681e-01 -3.49261552e-01\n",
      " -2.89887507e-02  6.09010577e-01 -5.72333097e-01  2.35000312e-01\n",
      "  6.47180341e-03 -3.14950123e-02  2.78106146e-02 -3.90340537e-01\n",
      " -2.08949938e-01 -3.04452777e-01 -7.20194504e-02 -8.29840451e-02\n",
      "  3.73792917e-01  7.38939717e-02 -2.21075490e-02  9.88139287e-02\n",
      " -1.51426539e-01 -1.40430972e-01  2.26017922e-01  2.76090145e-01\n",
      " -8.87749717e-02 -1.12816021e-01 -2.66286254e-01  2.77834326e-01\n",
      " -4.75612432e-02  6.71005994e-02 -2.78586429e-02 -2.39994992e-02\n",
      "  2.51708776e-01  4.68793720e-01 -5.39325356e-01  1.10598579e-01\n",
      " -3.44947159e-01  4.15989906e-01  7.28485137e-02 -3.19647372e-01\n",
      "  4.90374357e-01 -7.30329286e-03 -2.64250766e-03  9.63711083e-01\n",
      "  3.23885083e-01 -7.79618323e-02 -2.37589359e-01  2.34038532e-01\n",
      " -3.16054136e-01 -1.65643601e-03 -1.09070659e+00  3.38409215e-01\n",
      "  4.70604226e-02  1.07435621e-01 -2.06672028e-01  4.26453818e-03\n",
      " -1.38489099e-03 -5.31455457e-01 -2.75648326e-01 -1.64648443e-01\n",
      " -3.42916429e-01 -4.26118791e-01  6.01812124e-01  4.55971569e-01\n",
      " -2.72701919e-01 -3.45805250e-02  2.62752533e-01 -6.34194352e-03\n",
      "  2.79631197e-01 -2.53559083e-01 -1.68626398e-01  3.82935926e-02\n",
      "  2.07763121e-01 -4.31525975e-01 -7.23998100e-02 -1.26854450e-01\n",
      "  2.07029413e-02  5.74440956e-01  3.54672551e-01  9.28299949e-02\n",
      "  6.70507401e-02  1.11520559e-01 -1.86511055e-02  4.62352157e-01\n",
      "  2.72504568e-01 -3.60473782e-01  5.29415190e-01 -1.00326084e-03\n",
      " -8.81363526e-02  1.49975508e-01  5.25862351e-02  4.63517815e-01\n",
      " -3.96831512e-01  2.42640555e-01 -2.08912268e-01  3.65671962e-01\n",
      " -4.73423657e-04  5.33963025e-01 -1.97879702e-01  3.11583072e-01\n",
      " -6.96714818e-01 -4.29500639e-01 -4.49359536e-01 -2.71369722e-02\n",
      " -6.98709935e-02  2.06174776e-01 -1.57107860e-01  4.43521142e-01\n",
      " -6.74269274e-02 -3.00924122e-01  5.14859557e-01  3.36029321e-01\n",
      "  6.63375556e-02 -1.15235053e-01 -2.95980982e-02  2.79471844e-01\n",
      " -3.48198712e-02 -7.29322806e-02 -4.58472818e-02  1.54262751e-01\n",
      "  8.09355795e-01  5.20327985e-01 -4.02114600e-01 -3.23151127e-02\n",
      " -1.10364124e-01  7.50502869e-02 -1.51098594e-01  8.45740020e-01\n",
      " -1.80844054e-01  3.22573364e-01  1.04707882e-01  3.19663584e-01\n",
      " -1.55085564e-01  1.69236526e-01 -2.56996691e-01  2.01209098e-01\n",
      "  1.77392870e-01 -2.74333209e-01 -3.36944371e-01  5.02356768e-01\n",
      " -1.18357070e-01 -2.01167271e-01 -5.36485612e-01 -7.69810304e-02\n",
      "  1.15381293e-02 -2.36464426e-01 -2.98769586e-02  1.31366730e-01\n",
      "  2.94184476e-01  9.90915149e-02 -5.43897688e-01  1.40812859e-01\n",
      "  3.66998732e-01  5.04862145e-02  1.99122429e-01 -2.80674517e-01\n",
      "  4.34192240e-01 -1.40275151e-01  5.78048706e-01  1.77715689e-01\n",
      "  8.98360908e-02  3.29651654e-01  6.13006912e-02 -3.24933380e-01]\n",
      "\n",
      "Sentence: Sentences are passed as a list of string.\n",
      "Embedding: [ 0.3220876  -0.00123935  0.17937364 -0.36919165 -0.06460246  0.09153695\n",
      "  0.24119113 -0.29494208  0.07728951  0.1157702  -0.04479982  0.17928238\n",
      "  0.14753614  0.21511632  0.36810806  0.20910893  0.27194223  0.34880063\n",
      " -0.5725191  -0.18253206  0.44489563  0.27452943  0.04266286 -0.07683553\n",
      "  0.18689114  0.44965026 -0.16932616 -0.2489637  -0.20479251  0.40285036\n",
      " -0.21019273  0.03775735  0.07848528  0.12848434  0.02593078  0.47155932\n",
      "  0.1785379  -0.07379744  0.08130732 -0.23328751 -0.49801257 -0.04135667\n",
      " -0.12094593  0.17028998 -0.19154102 -0.38459837 -0.7747918  -0.1062272\n",
      " -0.2304489   0.4024144  -0.8745086   0.23853709 -0.47129866  0.21262164\n",
      "  0.33409342 -0.24154025 -0.14835083 -0.1451356  -0.3483092  -0.08349211\n",
      " -0.6909727  -0.29845268 -0.12230499  0.07482664 -0.18775606 -0.3754651\n",
      "  0.2136953  -0.10096409 -0.12234414  0.31431532 -0.23989958  0.2246077\n",
      "  0.03996018  0.36034814 -0.5663801   0.21883503  0.11020305 -0.10870821\n",
      "  0.07084102 -0.026082    0.18370333  0.08465932 -0.20478235 -0.244356\n",
      " -0.08180557 -0.01903089 -0.03591391  0.02398461 -0.28558564  0.07374766\n",
      " -0.29744223 -0.8771782   0.47101936 -0.04940486  0.36394504  0.4826438\n",
      "  0.01564619  0.0355891  -0.26203012 -0.11218459  0.02411036  0.37477762\n",
      " -0.09897284 -0.09851862  0.15000844  0.00689524 -0.12652427 -0.31598938\n",
      "  0.31449497 -0.29425612 -0.26941037  0.2022119   0.143299   -0.19584641\n",
      " -0.3410447  -0.03172762  0.7365027   0.3192351   0.2438129   0.30732572\n",
      "  0.09933242  0.19010916 -0.10694548  0.05178669  0.03233403 -0.10314638\n",
      "  0.26499167  0.31206453  0.43152574 -0.6426121   0.0840958  -0.04327327\n",
      " -0.04991198 -0.1271856   0.13789201  0.01306228  0.34383237  0.09234264\n",
      " -0.09922761 -0.52159894  0.25842264 -0.01057146 -0.00478157  0.03938885\n",
      "  0.19086064  0.329339   -0.24345146 -0.07328282 -0.39280006  0.1454178\n",
      "  0.3283954  -0.04184631  0.0740712  -0.7386051  -0.0907599   0.15802318\n",
      " -0.09780023 -0.21605964 -0.30027473  0.23236565  0.01072445  0.49570477\n",
      "  0.04974841  0.2993141  -0.05382232  0.35328105  0.3419177   0.4966725\n",
      " -0.48605233 -0.19098836  0.81545734  0.22962636 -0.32077777 -0.32726702\n",
      " -0.367717    0.34521168 -0.0262014  -0.14315037  0.10648424 -0.24638028\n",
      " -0.09366638  0.1719863  -0.08508804  0.2012031  -0.05879203 -0.34020957\n",
      " -0.19565316  0.28280854  0.20124331 -0.08207257  0.09779134 -0.26374987\n",
      "  0.12176569 -0.01041458 -0.43859833  0.11058234  0.48010394 -0.10981994\n",
      " -0.63754576  0.29336783 -0.1920765   0.46537018  0.27042007  0.19388472\n",
      "  0.17379056 -0.30077007 -0.02751167 -0.02291264  0.3678464   0.02492142\n",
      "  0.53705454  0.18851267 -0.13344422  0.08917336  0.05542941 -0.24818331\n",
      " -0.04199786  0.05767429 -0.18278804 -0.41686457  0.16070575 -0.4636253\n",
      "  0.11769233 -0.37706912  0.02960367  0.6925614  -0.48308924  0.21128373\n",
      "  0.1821453  -0.18429588  0.06817675 -0.02460923 -0.19073604 -0.06736975\n",
      " -0.56700724 -0.2392932  -0.08497233  0.0309398   0.31079903  0.12916261\n",
      "  0.05248255 -0.33449805  0.188101    0.23547153 -0.00183478  0.45361596\n",
      "  0.2488506  -0.05641079 -0.2977457  -0.43511721 -0.07969446 -0.1767016\n",
      " -0.13347083  0.19382711  0.22002587 -0.11057525  0.2647375  -0.27179042\n",
      "  0.03410895 -0.47714412  0.44719067 -0.05570407  0.39643744  0.27483237\n",
      "  0.33305594 -0.10890227  0.27888167  0.21596923 -0.05252247 -0.35867524\n",
      " -0.69062895  0.0396019   0.00652793 -0.01095335 -0.10027714  0.04770026\n",
      " -0.34146908 -0.16714181  0.07136427 -0.18078464 -0.3024847  -0.6842874\n",
      " -0.09592844 -0.21411109 -0.6552437   0.5675643   0.2694671  -0.00190069\n",
      "  0.86180633  0.16771568  0.03102776 -0.26773074 -0.07830309 -0.48510864\n",
      " -0.2673722  -0.3335428  -0.5738251   0.35678244  0.08993592 -0.13057166\n",
      " -0.1513649  -0.06124151 -0.13037068  0.55856043  0.61417496 -0.04804069\n",
      " -0.06388576  0.08390597 -0.25143683 -0.04359831 -0.18525797  0.04693338\n",
      " -0.3438083  -0.09738464  0.16833638  0.07526851  0.17694482  0.17727166\n",
      " -0.03423452  0.14993568 -0.13773178 -0.20949693 -0.6127283   0.37813967\n",
      "  0.39018267 -0.08359322  0.0315215   0.13122393  0.38826075  0.21844245\n",
      "  0.09724276  0.4208935  -0.32641235 -0.2693339  -0.39095098 -0.22648668\n",
      " -0.32020733 -0.1628742  -0.03581638  0.36373857  0.18583278 -0.02914031\n",
      " -0.46577942  0.29168907  0.37251264 -0.23726615  0.00338628  0.41540968\n",
      "  0.03300457  0.45003983 -0.08159235  0.33990327  0.24497868  0.02352414\n",
      " -0.1464307  -0.12644553  0.31128645 -0.15182616  0.01009408  0.49108523\n",
      "  0.14362408  0.11589045 -0.2323698   0.24751768  0.18364502 -0.24836835\n",
      " -0.11220919 -0.23113336  0.08428958 -0.24378656  0.1330727   0.4235567\n",
      "  0.33348346 -0.3437014   0.03443648  0.1879552   0.2003718  -0.05355939\n",
      "  0.28485277  0.07176551  0.05487126 -0.08103789  0.27076903  0.11700265]\n",
      "\n",
      "Sentence: The quick brown fox jumps over the lazy dog.\n",
      "Embedding: [ 0.58979344 -0.23598318 -0.25411722  0.00311608 -0.08485717 -0.2679973\n",
      " -0.07506662 -0.3002135   0.05151672  0.16585319  0.2607675   0.38256347\n",
      "  0.43732905 -0.09301993 -0.26568764 -0.09716292 -0.48095998  0.1187827\n",
      "  0.13675494  0.04712085 -0.23696522 -0.52332383 -0.01631862  0.06127267\n",
      " -0.7433302  -0.11898914 -0.7886529  -0.48108828  0.1031493  -0.32372424\n",
      "  0.8144377  -0.39774537 -0.50315624 -0.7972459  -0.6324826   0.32320973\n",
      " -0.384194   -0.11186675 -0.13243608  0.02069718 -0.14309551 -0.03701135\n",
      "  0.06116633  0.16332924 -0.11174301  0.25234243 -1.0464071  -0.37252375\n",
      "  0.15601976 -0.29991576  0.19883867  0.23433428 -0.37025774  0.3173358\n",
      "  0.84428614  0.06977689  0.03273651  0.09948324 -0.31141353  0.50517744\n",
      "  0.00309242  0.38013682  0.04582766  0.00633369 -0.00142936 -0.13568659\n",
      " -0.07611412 -0.2584428  -0.8022127   0.5508588  -0.0912438  -0.21782039\n",
      " -0.788109   -0.5118379   0.46672547  0.55274737 -0.37124744 -0.18645316\n",
      "  0.35856998 -0.19586365  0.18042533 -0.42548883 -0.09681386 -0.05536797\n",
      "  0.524893    0.24481136  0.01934644 -0.29637912 -0.12777857 -0.30534938\n",
      "  0.45349345  0.07469135 -0.07061688  0.26242992  0.37383938  0.14306365\n",
      "  0.00127894 -0.4177606  -0.24014108 -0.25093535  0.34843734  0.31144086\n",
      "  0.08087351 -0.5764052   0.54085296 -0.01802217 -0.1295978  -0.07399677\n",
      "  0.3936979   0.6488382  -0.02029993 -0.5665555   0.29675993  0.52000266\n",
      "  0.21538784  0.10369649  0.06199207  0.01896268 -0.15269159 -1.0642662\n",
      "  0.76149625  0.20734376  0.44718933  0.14493938  0.65802294 -0.09440923\n",
      " -0.23316367  0.42157087  0.11957628 -0.32571036  0.16425504 -0.49508676\n",
      " -0.19516106 -0.5618325  -0.14933248  0.61094105 -0.17897962 -0.01805526\n",
      " -0.59640473  0.04918614  0.15347816 -0.42829394  0.7329529  -0.35291132\n",
      " -0.11159617  0.06127803 -0.29704428  0.43966556 -0.09660379  0.65579426\n",
      " -0.6140337   0.02576614  0.43827447  0.01733213 -0.4000226  -0.08178326\n",
      " -0.37126982  0.08230278 -0.1310441  -0.53261113 -0.29928362  0.6993656\n",
      " -0.04398746 -0.15703003  0.09794104 -0.03017484 -0.10002717  0.19996578\n",
      " -0.48188546  0.17949139  0.56566006 -0.11954824 -0.6963732   0.05259692\n",
      " -0.0054965   0.16739346 -0.31692883 -0.09747563  0.33193675  0.47199628\n",
      "  0.12654014  0.19130959  0.4294901   0.5529125   0.31463286 -0.31433102\n",
      " -0.41508687  0.32897735  0.3570269  -0.19209628  0.22239392 -0.4871786\n",
      "  0.34091547 -0.22137469 -0.12667547  0.21120794 -0.3134789   0.846894\n",
      "  0.20112658 -0.42598757  0.5131572  -1.2351414   0.76971775 -0.17414284\n",
      " -0.02181111 -0.03568642 -1.105949   -0.5720654   0.05585252  0.12461481\n",
      " -0.4506588   0.06428963 -0.1603388   0.39932942 -0.10322896 -0.02025502\n",
      " -0.18010487  0.06234779 -0.02188891 -0.15795398  0.28316963  0.02385303\n",
      "  0.03098099 -0.07853287  0.29896528 -0.06237333  0.5498677   0.17862324\n",
      "  0.21164757  0.44483414  0.04890763 -0.16238084 -0.22669882  0.18872003\n",
      "  0.07943635  0.13597572 -0.1848445   1.1135508   0.82809544 -0.31202698\n",
      "  0.09505964  0.05096054  0.3880489   0.2500045   0.5584859   0.31088728\n",
      " -0.05318564 -0.07675362  0.15282299  0.09189992 -0.01429144  0.6657542\n",
      " -0.03346023 -0.4470351   0.8006749  -0.47992793  0.17478192 -0.3056388\n",
      "  0.5536523   0.4238094   0.48674318 -0.49678013 -0.45194808 -0.9556308\n",
      " -0.20709975 -0.22605747 -0.0099919   0.9879771   0.5880777   0.083055\n",
      " -0.55781347  0.21136837 -0.36072195  0.52668494  0.33983603 -0.15756162\n",
      "  0.00423792 -0.0535448  -0.5777671   0.5595107  -0.05747151  0.16837649\n",
      "  0.37946877 -0.25776395  0.08421502 -0.15229921 -0.03280797  0.10083851\n",
      " -0.41858315 -0.44499025 -0.29309908  0.61442065  0.0854817  -0.06349546\n",
      " -0.61525553  0.79544115 -0.2405837   0.20638865 -0.51252574  0.6312014\n",
      "  0.36744332 -0.4400992   0.46913958  0.2308772  -0.1373799   0.21696885\n",
      "  0.40043226 -0.02490685 -1.1396756   0.02653854 -0.3273023   0.09984138\n",
      "  0.05725643 -0.8472217   0.06451944  0.45698032  0.63562983  0.4518565\n",
      " -0.27519026  0.21346146  0.17374282  0.4282205  -0.65845376  0.40002546\n",
      " -0.02035517 -0.6730786  -1.0269238   0.16877238 -0.09248757 -0.79977614\n",
      "  0.38093424  0.5171229   0.04200912 -0.04867585 -0.18772274  0.16339514\n",
      " -0.21974915  0.21939301  0.03676518 -0.29750264 -0.3740963  -0.5209505\n",
      " -0.41314626 -0.48947716 -0.8189661   0.08531492  0.34576988  0.12506011\n",
      "  0.24945265 -0.252547   -0.03156111  0.2757314  -0.608572    0.3356998\n",
      "  0.22913158  0.66070825 -0.3021583  -0.05315316  0.22247519  0.06138703\n",
      "  0.33555153 -0.0848517   0.08764585  0.10872054 -0.40389335 -0.14949764\n",
      "  0.1945848  -0.81060666  0.7973096  -0.4116255   0.01364158  0.23472928\n",
      " -0.09732274 -0.2904404   0.03843198 -0.07090437 -0.17404497 -0.44859388\n",
      " -0.31867257  0.41656053 -0.05431652  0.14036195  1.0559162   0.5301817 ]\n",
      "\n"
     ]
    }
   ],
   "source": [
    "from sentence_transformers import SentenceTransformer\n",
    "model = SentenceTransformer('paraphrase-MiniLM-L6-v2')\n",
    "\n",
    "#Our sentences we like to encode\n",
    "sentences = ['This framework generates embeddings for each input sentence',\n",
    "    'Sentences are passed as a list of string.',\n",
    "    'The quick brown fox jumps over the lazy dog.']\n",
    "\n",
    "#Sentences are encoded by calling model.encode()\n",
    "embeddings = model.encode(sentences)\n",
    "\n",
    "#Print the embeddings\n",
    "for sentence, embedding in zip(sentences, embeddings):\n",
    "    print(\"Sentence:\", sentence)\n",
    "    print(\"Embedding:\", embedding)\n",
    "    print(\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Comparing Sentence Similarities"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3547a2590deb43898cd987b33cff3c36",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/1.18k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bfa759222d27455ba3b0ccf3f05aa41f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/10.2k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "6007894c6e924529a0d35e6d7e95f2ac",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/612 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "50ab8327e77c42868a1376a1e1b1e9d9",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/116 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "7318c6f5a2a04a939541fa9f588235b7",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/39.3k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b1011c63b744462b8fddb21ab8d5df09",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/349 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3e2475eba61345e09dc6193745af9059",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/90.9M [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5d73d4b507ea47b7bab9727461a99474",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/53.0 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "42369d7f283c4b9081aee926fd719040",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/112 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bc517931686d4690a300da42146879b8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/466k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ff21118cef6748f3809c1d98b77aecfa",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/350 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "decd6e33db3c4933ad7d1ba8ae4ed002",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/13.2k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "aba8b52041f14c3485422ede0cf81e06",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/232k [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ea3829fe250f4a1296c4fd10b9380540",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Downloading:   0%|          | 0.00/190 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cosine-Similarity: tensor([[0.6153]])\n"
     ]
    }
   ],
   "source": [
    "from sentence_transformers import SentenceTransformer, util\n",
    "model = SentenceTransformer('all-MiniLM-L6-v2')\n",
    "\n",
    "#Sentences are encoded by calling model.encode()\n",
    "emb1 = model.encode(\"This is a red cat with a hat.\")\n",
    "emb2 = model.encode(\"Have you seen my red cat?\")\n",
    "\n",
    "cos_sim = util.cos_sim(emb1, emb2)\n",
    "print(\"Cosine-Similarity:\", cos_sim)"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "61a57a4b5406d2de388e2f91097d4e4bcd7d5f4a46f53a795aa28a02eed27fc5"
  },
  "kernelspec": {
   "display_name": "Python 3.8.8 64-bit ('base': conda)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
